<%@ include file="/common/taglibs.jsp"%>

<head>
	<link href="${ctx}/ext/styles/style1/icon.css" rel="stylesheet"
		type="text/css">
	<link href="${ctx}/ext/styles/style1/tabs.css" rel="stylesheet"
		type="text/css">
	<link rel="stylesheet" type="text/css" media="all"
		href="${ctx}/ext/styles/content/report.css" />
	<link rel="stylesheet" type="text/css" media="all"
		href="${ctx}/ext/styles/content/content.css" />
	<script type="text/javascript" src="http://www.google.com/jsapi">
</script>
	<script src="<c:url value='/ext/scripts/jquery/jquery.easyui.min.js'/>"
		type="text/javascript">
</script>
	<script
		src="<c:url value='/ext/scripts/jquery/jquery.gvChart-1.0.1.min.js'/>"
		type="text/javascript">
</script>
	<script type="text/javascript">
jQuery(function() {
	jQuery("#tabs").tabs();
});
</script>
	<script type="text/javascript">
gvChartInit();
function getListByProperties(strvalue) {
	return strvalue.split(',');
}
function hiddenselectconbyid(divid) {
	if ($(divid).style.display == 'none') {
		$(divid).style.display = '';
	} else {
		$(divid).style.display = 'none';
	}
}
jQuery(document)
		.ready(
				function() {
					var territoryvalue = "<fmt:message key='count.territory.info'/>";
					var gradevalue = "<fmt:message key='count.grade.info'/>";
					var countterritoryvalue = "<fmt:message key='count.pic.condition.info'/>";
					var countpicvalue = "<fmt:message key='count.pic.info'/>";
					var comp = "<fmt:message key='count.user.company'/>";
					var num = "<fmt:message key='count.num'/>";

					var territorylist = getListByProperties(territoryvalue);
					var gradelist = getListByProperties(gradevalue);
					var countterritorylist = getListByProperties(countterritoryvalue);
					var countpiclist = getListByProperties(countpicvalue);

					for ( var i = 0; i < territorylist.length; i++) {
						jQuery('#territoryid').append(
								"<option value='" + (i + 1) + "'>"
										+ territorylist[i] + "</option>");
					}
					for ( var i = 0; i < gradelist.length; i++) {
						jQuery('#gradeid').append(
								"<option value='" + (i + 1) + "'>"
										+ gradelist[i] + "</option>");
					}
					for ( var i = 0; i < countterritorylist.length; i++) {
						jQuery('#countterritoryid').append(
								"<option value='" + i + "'>"
										+ countterritorylist[i] + "</option>");
					}
					for ( var i = 0; i < countpiclist.length; i++) {
						jQuery('#countpicid').append(
								"<option value='" + i + "'>" + countpiclist[i]
										+ "</option>");
					}
					var result = document.getElementById("result").value;
					var countType = document.getElementById("countType").value;
					//alert(result+"-------------"+countType);
					var ct = "PieChart";
					if (countType == 2) {
						ct = "LineChart";
					} else if (countType == 1) {
						ct = "ColumnChart";
					} else {
						ct = "PieChart";
					}
					if (result == "true") {
						jQuery('#myTable1').gvChart( {
							chartType : ct,
							gvSettings : {
								vAxis : {
									title : num
								},
								hAxis : {
									title : comp
								},
								width : 720,
								height : 300
							}
						});
					}
				});
</script>
</head>
<div class="box_big">
	<div class="tab2">
		<div class="biaotab">
			<a onfocus="this.blur()" href="###" class="on" name="tab" id="tab1"
				onclick="sjTabDo(this.id,this.name)"><span><font><fmt:message
							key="count.list.count" /> </font> </span> </a>
			<a onfocus="this.blur()" href="###" id="tab2" name="tab"
				onclick="sjTabDo(this.id,this.name)"><span><font><fmt:message
							key="count.pic.report" /> </font> </span> </a>
		</div>
		<div class="box margin_b3" id="tab1_con">
			<div class="kdw_conbg height215">
				<form:form action="reportcount/usercount.html" method="post">
					<div class="bj_biao"
						onclick="hiddenselectconbyid('selectcondivsear');">
						<h4>
							<fmt:message key="count.search.condition" />
						</h4>
					</div>
					<div class="box5" id="selectcondivsear">
						<table  border="0" cellspacing="0" cellpadding="0" class="table_bj">
							<tr height="18">
								<th>
									<fmt:message key="count.user.territory" />
									:
								</th>
								<td width="30%">
									<select id="territoryid" name="territory" class="text4">
									</select>
								</td>
								<th>
									<fmt:message key="count.user.grade" />
									:
								</th>
								<td width="30%">
									<select id="gradeid" name="grade" class="text4"></select>
								</td>
								<th>
									<fmt:message key="count.user.company" />
									:
								</th>
								<td>
									<input name="company" type="text" class="text4" />
								</td>
							</tr>
							<tr>
								<th>
									<fmt:message key="count.register.starttime" />
									:
								</th>
								<td>
									<input name="starttime"
										onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',lang:'${lang}'});"
										class="Wdate text3" />
								</td>
								<th>
									<fmt:message key="count.register.endtime" />
									:
								</th>
								<td colspan="2">
									<input name="endtime"
										onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',lang:'${lang}'});"
										class="Wdate text3" />
								</td>
							</tr>
						</table>
					</div>
					<div class="bj_biao"
						onclick="hiddenselectconbyid('selectcondivgroup');">
						<h4>
							<fmt:message key="count.group.condition" />
						</h4>
					</div>
					<div class="box5" id="selectcondivgroup" style="display: none;">
						<table style="border-width: 1px;" width="900px">
							<tr>
								<td>
									<fmt:message key="count.user.territory" />
									<input type="checkbox" name="group" value="territory">
									<fmt:message key="count.user.company" />
									<input type="checkbox" name="group" value="company">
									<fmt:message key="count.grade" />
									<input type="checkbox" name="group" value="grade">
								</td>
							</tr>

						</table>
					</div>
					<div class="bj_biao"
						onclick="hiddenselectconbyid('selectcondivorder');">
						<h4>
							<fmt:message key="count.order.condition" />
						</h4>
					</div>
					<div class="box5" id="selectcondivorder" style="display: none;">
						<table style="border-width: 1px;" width="900px">
							<tr>
								<td>
									<fmt:message key="count.user.territory" />
									<input type="checkbox" name="order" value="territory">
									<fmt:message key="count.user.company" />
									<input type="checkbox" name="order" value="company">
									<fmt:message key="count.grade" />
									<input type="checkbox" name="order" value="grade">
									<fmt:message key="count.num" />
									<input type="checkbox" name="orderNum">
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<fmt:message key="count.order.asc" />
									<input type="radio" name="sortDesc" value="asc" />
									<fmt:message key="count.order.desc" />
									<input type="radio" name="sortDesc" value="desc" />
								</td>
							</tr>
						</table>
					</div>
					<table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr height="50" valign="top">
							<td align="center">
								<input type="submit" value="<fmt:message key="button.search"/>"
									class="btn_blue2" />
							</td>
						</tr>
					</table>
				</form:form>
			</div>
			<div class="clear"></div>
			<div class="box_di">
				<div class="box_dir"></div>
			</div>
		</div>
		<div class="box margin_b3" id="tab2_con" style="display: none;">
			<div class="kdw_conbg height215">
				<form:form action="userreport.html" method="post">
					<div class="bj_biao"
						onclick="hiddenselectconbyid('selectcondivreport');">
						<h4>
							<fmt:message key="count.pic.report" />
						</h4>
					</div>
					<div class="box5" id="selectcondivreport">
						<table border="0" cellspacing="0" cellpadding="0" class="table_bj">
							<tr height="18">
								<th>
									<fmt:message key="count.register.starttime" />
								</th>
								<td>
									<input name="starttime" type="text" class="Wdate text3"
										onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',lang:'${lang}'})">
									<input type="hidden" id="result" value="${userlistresult}">
									<input type="hidden" id="countType" value="${countType}">
								</td>
								<th>
									<fmt:message key="count.register.endtime" />
								</th>
								<td>
									<input name="endtime" type="text" class="Wdate text3"
										onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',lang:'${lang}'})">
								</td>
							</tr>
							<tr>
								<th>
									<fmt:message key="count.pic.company" />
								</th>
								<td>
									<select id="countterritoryid" name="countterritory" class="text4"></select>
									<input type="hidden" id="result" value="${userlistresult}">
									<input type="hidden" id="countType" value="${countType}">
								</td>
								<th>
									<fmt:message key="count.pic.type" />
								</th>
								<td>
									<select id="countpicid" name="countpic" class="text4"></select>
								</td>
							</tr>
						</table>
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr height="50" valign="top">
								<td align="center">
									<input type="submit" value="<fmt:message key="button.search"/>"
										class="btn_blue2" />
								</td>
							</tr>
						</table>
					</div>
				</form:form>
				<c:if test="${userlistresult == 'true'}">
					<div style="padding: 10px; disply: none;">
						<h2 id="area">

						</h2>
						<table id='myTable1'>
							<caption>
							</caption>
							<thead>
								<tr>
									<th>
									</th>
									<c:forEach var="view" items="${userlists}">
										<th>
											${view.value}
										</th>
									</c:forEach>
								</tr>
							</thead>
							<tbody>
								<tr>
									<th>
									</th>
									<c:forEach var="view1" items="${userlists}">
										<td>
											${view1.num}
										</td>
									</c:forEach>
								</tr>
							</tbody>
						</table>
					</div>
					<div>
						<table>
							<tr>

							</tr>
						</table>
					</div>
				</c:if>
			</div>

			<div class="clear"></div>
			<div class="box_di">
				<div class="box_dir"></div>
			</div>
		</div>
	</div>
</div>


